<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateReservationTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('reservation', function (Blueprint $table) {
            $table ->increments('id')->comment('预约文章表');
            $table ->string('title') ->nullable() ->comment('文章标题');
            $table ->text('content') ->comment('文章内容');
            $table ->text('description') ->nullable() ->comment('文章描述');
            $table ->text('imgs') ->nullable() ->comment('多图');
            $table ->string('video') ->nullable() ->comment('视频地址');
            $table ->string('video_img', 255)->nullable()->comment('视频地址');
            $table ->string('service_category_id') ->nullable() ->comment('预约服务分类ID');
            $table ->integer('expert_user_id') ->default('0') ->comment('专家ID');
            $table ->tinyInteger('expert_comment_state') ->default('0') ->comment('未评论0，已评论1');
            $table ->string('contact') ->nullable() ->comment('发布者的联系方式');
            $table ->tinyInteger('types') ->default('0') ->comment('图片1，视频2');
            $table ->integer('region_id') ->default('0') ->comment('所属地区ID（1.北洸村）');
            $table ->integer('zan_num') ->default('0') ->comment('点赞次数');
            $table ->integer('comment_num') ->default('0') ->comment('评论次数');
            $table ->integer('share_num') ->default('0') ->comment('分享次数');
            $table ->tinyInteger('is_top') ->default('0') ->comment('置顶');
            $table ->integer('weight') ->default('0') ->comment('权重');
            $table ->tinyInteger('is_show') ->default('1') ->comment('展示1，隐藏0');
            $table ->integer('user_id') ->default('0') ->comment('用户作者ID');
            $table ->timestamps();
            $table ->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('reservation', function (Blueprint $table) {
            //
        });
    }
}
